<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <base target="_self">

<script type="text/javascript" src="${path}/js/basic.js"></script>
<link rel="stylesheet" type="text/css" href="${path}/css/public.css" />
<link rel="stylesheet"
      href="${path}/js/themes/base/jquery.ui.all.css">
<script type="text/javascript" src="${path}/js/jquery-1.7.2.js"></script>

<script type="text/javascript"
        src="${path}/js/jquery.ui.core.js"></script>
<script type="text/javascript"
        src="${path}/js/jquery.ui.datepicker.js"></script>
<script type="text/javascript"
        src="${path}/js/jquery.ui.datepicker-zh-CN.js"></script>
<style type="text/css">
    .mytable{
        width: 60%;
    }
    .mytable td{
        width: 200px;
    }
</style>
<script type="text/javascript">
    $(function () {
        $("#add_0").click(function () {
            window.close();
        });

        $("#add_dept_parent_id").change(function () {
            var deptId=$(this).val();
            $("#add_dept_id").val(deptId);
            if("-1"!=deptId && ""!=$("#add_dept_deptName").val()){
                $("#add_0").removeAttr("disabled");
            }
        });
    });
</script>
</head>
<body>
<!-- 中部DIV -->
<div class="content">
    <div class="pageHead">
        <table>
            <tr>
            <tr>
                <th width="8"><img src="${path}/images/c_l.gif" height="31" width="8"/></th>
                <th align="left" class="title_area">当前位置：新增部门</th>
                <th width="9"><img src="${path}/images/c_r.gif" height="31" width="9"></th>
            </tr>
            </tr>
        </table>
    </div>
    <div class="pageBody">
        <center>
            <form id="add" name="editForm" action="${path}/dept/add.do" method="post">
                <input type="hidden" name="deptId" value="" id="add_dept_id"/>
                <input type="hidden" name="deptVersion" value="" id="add_dept_version"/>
                <div class="pageBody">
                    <div class="customerDiv">
                        <table class="mytable">
                            <tr>
                                <th>部门名称</th>
                                <td><input type="text" name="deptDeptName" value="" id="add_dept_deptName"/></td>
                            </tr>
                            <tr>
                                <th>描述</th>
                                <td><input type="text" name="deptRemark" value="" id="add_dept_remark"/></td>
                            </tr>
                            <tr>
                                <th>父部门</th>
                                <td>
                                    <select name="deptParentId" id="add_dept_parent_id">
                                        <option value="-1">--请选择部门--</option>
                                        <c:if test="${empty departments}" var="b">no dept</c:if>
                                        <c:if test="${!b}">
                                            <c:forEach items="${departments}" var="dept">
                                                <option value="${dept.id}">${dept.deptName}</option>
                                            </c:forEach>
                                        </c:if>
                                    </select>
                                </td>
                            </tr>
                        </table>
                        <div class="buttonBar">
                            <input type="submit" disabled="disabled" id="add_0" value="保存" class="mybutton"/>
                        </div>
                    </div>
                </div>
            </form>
        </center>
    </div>
</div>
</body>
</html>
